import request from "@/utils/request";

/**
 * 获取云存储临时密钥
 */
export function stsDispatcherAPI() {
    return request({
        url: "/x/v1/oss/stsDispatcher",
        method: "GET",
    });
}
/**
 *服务器端简单上传接口
 * @param {File} file 需上传的文件
 * @param {string} dir 上传的文件夹
 */
export function serverSimpleUploaderAPI(file, dir = "") {
    const formData = new FormData();
    formData.append("file", file);
    formData.append("dir", dir);
    return request({
        url: "/x/v1/oss/simpleUploader",
        method: "POST",
        data: formData,
    });
}